HVS¬ (Human Visual Systems) Color is a sophisticated tool for generating 8-bit images from 24-bit source images. It uses a patented psychovisual processing technique that offers extremely high quality, and is able to produce smaller GIF files than conventional dithering techniques. HVS Color also offers a high degree of user control over the color reduction process, including parameters such as gamma basic, thresholding and controlled weighting of color allocation, partition size and set point that are not controllable in standard color reduction software.
HVS¬ Color is available for Adobe Photoshop as a File Export plugin (Windows or Mac), or as a custom code module for Debabelizer (Mac only). The Photoshop version accepts any RGB image and produces an 8-bit .BMP file as output. The Debabelizer version produces an indexed image within Debabelizer, which can then be saved in any of Debabelizer╒s output formats.
HVS¬ Color images should be viewed on a video adapter that is capable of displaying 256 colors out of 17 million (24 bits). Some adapters are only capable of displaying 256 colors out of 65K (16 bits). HVS Color output will not appear optimal in the latter configuration.
About Color Reduction
Why Reduce Colors?
When an image is scanned or created as an RGB image in an editing program such as Adobe Photoshop, it is commonly stored as a 24-bit image. These images are usually too large (approximately 1 MB for a 640 X 480 24-bit image) to distribute uncompressed on CD-ROM or online. For this reason, developers use one of two methods to reduce the size of the image. In the first, the image can be made smaller using a lossy compressor such as JPEG. This reduces the size of the image, but introduces artifacts and takes longer to decompress. Also, the image still has 24 bits of color information, and the user╒s video adapter might not be capable of displaying 17 million colors simultaneously in the resolution being used. This will cause dithering when the image is displayed, further corrupting the perceived quality of the end result.
Indexed Images
The second method of size reduction involves converting the image from RGB to Indexed Mode, which causes each pixel to have 8 bits of color information instead of 24 bits. Each pixel has an 8 bit value which is used as an index into a Color Lookup Table (CLUT). Each entry in this table has a 24-bit color value, and the table can have up to 256 entries. Therefore, indexed images must be represented by a palette which chooses up to 256 colors out of 17 million. These images are one-third the size of 24-bit images with the same resolution, plus the overhead of the color table (approximately 1K bytes). Because all display adapters can display 8-bit images, the image can be viewed as it is, without further decoding or dithering by the operating system.
Color Reduction Challenges
It is extremely difficult to select 256 colors that accurately represent the image without visible color banding. Most paint and image editing programs have a built-in method of color reduction that relies upon some statistical method. That is, colors are allocated according to their frequency in the original image. The problem with this approach is that it doesn╒t take into account the way the human eye perceives color. For example, if two colors are placed next to each other and are even slightly different, the eye will clearly perceive a dark boundary between the two color regions, causing visible banding.
Diffusion
To minimize banding, most color reduction software uses another step, called diffusion, that attempts to reduce the effects of visible color boundaries. This is a form of dithering that intermixes pixels of the two colors, causing digital noise at the boundary.
Diffusion introduces a number of secondary problems. First, it never really works - to varying degrees, the eye is not completely fooled, and in some cases the results are visibly unpleasant. Secondly, dithering usually introduces more complexity in the image, making it much more difficult to do lossless compression. Some dithering algorithms actually introduce more order into the image because they use extremely regular dot patterns; however, these algorithms also produce inferior visual results.
HVS Psychovisual Color Reduction
All of the tools in the Digital Frontiers HVS Series use various psychovisual algorithms in determining the value and allocation of colors. Such algorithms are a central part of HVS Color. In this product, a patented process that models the way the human eye perceives and masks color is used. As opposed to simple statistical methods, HVS tools are able to synthesize and allocate colors in a way that minimizes visible banding without having to resort to diffusion dithering. HVS Color images are comprised of regions of pure color. These images when placed in direct proximity appear to be virtually identical to the 24-bit source image. Because the resulting color structure is less complex, HVS Color images usually compress better than corresponding dithered images.
Basic Color Reduction Parameters
Input Image Gamma
Input Image Gamma is a calculation that is used to compensate for the non-linearity of display monitors.Although Gamma has a significant effect on the appearance of an image, unfortunately, there is poor standardization in the industry as to when and how much Gamma-correction should be applied. Most graphics formats have no provision for this information.
This value should be set to the Gamma-correction value of the image which is currently being processed by HVS Color. The default setting is 1 (meaning that the image is non-Gamma-corrected). If your image has been Gamma-corrected usual values for Image Gamma are 1.8 to 2.4. If you do not know the Gamma-correction value of your current image try 1 (not Gamma-corrected) and 2.2 (Gamma-corrected) and see which value gives you the image that is closest to the original. If you do know the Gamma-correction of your current image then enter this number as the Input Image Gamma.
Display Gamma
This value determines the Gamma-correction of the processed CLUT image which is output by HVS Color. This value should be set to the estimated display Gamma value of the monitor(s) on which the CLUT images will be viewed. Most display Gammas are usually between 1.8 and 2.4. The default setting for Display Gamma is the value of Input Image Gamma. There are few display monitors with built in Gamma-correction. If the target monitor has built in Gamma-correction, which is usually between 0.9 and 1.2, then set this value to 1. As a rule of thumb, Effective Gamma = Display Gamma/Built-in Gamma Correction.
Note that if your images will be viewed on monitors that are not gamma-corrected either internally or at the systems or applications software level, you should create the same viewing environment when editing your images so you can properly judge the results of color reduction.
For example, Photoshop allows you to set Gamma, ambient light and light temperature in the File/Preferences/Monitor Setup... menu to correct for your viewing conditions. Gamma should be set to 1 in Photoshop if you wish to do Gamma-correction within the image, assuming that it will be viewed without Gamma-correction. Display Gamma would be set to approximately 2.2 in this case.
Banding Compensation
The banding compensation parameter determines the size of blocks in which HVS Color processes the image. High Shading should be used for natural images in which color shading is more important than color transitions at edges. Low Shading should be used for natural images in which color transitions between delineated edges are most important, and Medium Shading for a balance of both. The High Shading option produces the smoothest color transitions, but takes the longest to process. For computer-generated images with strong primary colors and runs of uniform color in shaded areas, Low Shading works best in most cases.
Number of Colors
This value sets the number of colors that HVS Color will reserve in the color table for the indexed output image. Setting this value lower than the default of 256 allows you to reserve a certain number of colors for merged palettes. For example, under Microsoft Windows it is common to use only 236 colors for custom palettes, reserving 20 for the Windows system colors.
Advanced Color Reduction Parameters
The advanced features make available a high degree of control for those users who wish to tune the color reduction process for particular images. Please note that improper settings in these parameters can significantly alter the final output, and there are strong interactions between some of the parameters.
Thresholds
The Thresholds section allows you to control how HVS Color forces portions of color space to a fixed color. The setting of upper and lower thresholds is image dependent. The lowest upper and highest lower thresholds that are visibly acceptable for an image should be used.
Luma Threshold Lower/Upper
This setting determines the degree to which dark and light colors are compressed. The human eye cannot easily perceive differences in very dark or very bright colors, making it possible to reduce the size of color space and achieve better results in the midrange colors. The lower Luma threshold allows you to force all colors with a Luma (the ╥Y╙ value of YCrCb space) below the threshold to a single value, determined by the Dark Set parameter explained below. The upper Luma threshold does a similar thing for bright colors, with the exception that you cannot control the value to which these colors are forced.
Thresholding is desirable because it allows you to maximize the use of the color table for colors to which the eye is most sensitive, thereby allowing the psychovisual algorithm to better minimize banding effects. Thresholding also produces a ╥flattening╙ effect on thresholded color regions, which can have a positive effect on compressioncompression. Values of 16 for darks and 240 for bright colors are the default, and safe for most images. More extreme values are possible for certain images, depending upon the color distribution and values in an image. Computer-generated images may require lower dark thresholds if they use mainly primary colors. Too much clipping will result in harsh boundaries between thresholded and non-thresholded colors.
Blue Threshold Lower/Upper
This setting determines the levels at which the Chroma Blue component (the ╥Cb╙ in YCrCb) will be clipped. Default values are 16 and 240 for lower and upper bounds respectively.
Red Threshold Lower/Upper
This setting determines the levels at which the Chroma Red component (the ╥Cr╙ in YCrCb) will be clipped. Default values are 16 and 240 for lower and upper bounds respectively.
Blue Weighting
This parameter determines the weight given to the Blue component lower (darkness) threshold relative to the lower Luma Threshold value. The default setting is 0. This setting causes the maximum number of blue values to be thresholded (clipped). A higher setting than the default value will reduce the number of blue values thresholded to a single dark value.
For equal contributions to dark thresholding for both Blue, Red and Green set Blue Weighting to 2.4 and Red Weighting to 1.5. For images with predominantly flesh tones and reds leave Blue Weighting at default (i.e. 0) and set Red Weighting to 1.5. However, for images with predominantly natural scenes dominated by blues and greens set Blue Weighting to 2.4 and leave Red Weighting at default (i.e. 0).
Red Weighting
This parameter determines the weight given to the Red component lower (darkness) threshold relative to the lower Luma Threshold value. The default setting is 0. This setting gives an average weighting to having the maximum number of red values thresholded to a single dark red value. A higher setting than the default value will reduce the number of red values thresholded to a single dark value and a lower setting than the default value will increase the number of red values thresholded to a single dark value.
For equal contributions to dark thresholding for both Blue, Red and Green, set Blue Weighting to 2.4 and Red Weighting to 1.5. For images with predominantly flesh tones and reds leave Blue Weighting at default (i.e. 0) and set Red Weighting to 1.5. However, for images with predominantly natural scenes dominated by blues and greens set Blue Weighting to 2.4 and leave Red Weighting at default (i.e. 0).
Dark Set Point
This parameter determines the Luma value to which dark colors falling below the threshold are set in the color lookup table. The default value is 8 or the lower luma threshold, whichever is lower.
Light Set Point
This parameter determines the Luma value to which light colors falling above the threshold are set in the color lookup table. The default value is the midway point between the upper threshold and 255.
Emphasis
This parameter determines how many colors in the color look up table are occupied by darker versus lighter colors. A low setting gives more precedence (a larger portion of the color table) to dark colors, while a high setting assigns more importance to bright colors. The default is 0, which is neutral.
Color Compensation
If on, this parameter triggers a final color-correction pass in which the R, G and B values in the color table are adjusted to correct for any variance in the average of each color between the 8-bit image and the 24-bit image. Default is on. You should leave this value on unless it causes noticeable color problems in the output.
Preparing the Source Image
Ideally, you should know whether your source images have been Gamma-corrected or not, and care should be taken in digitizing and conversion to minimize the introduction of noise. Noise will convert to random colors that will make the image less attractive and harder to compress.
Compression Issues
HVS Color will generally produce images that compress better than dithered images due to its use of regions of pure color. Certain dithering algorithms that produce unpleasant visual results can result in files that compress well, due to the use of highly regular dot patterns in the dithering process. Here are some suggestions for producing the smallest possible compressed files with HVS Color:
1. Preprocess your images with high-quality noise and lowpass filters before performing the color conversion. Contact Digital Frontiers for information on our professional-quality digital filter series.
2. Flatten the blacks in your images by setting the Luma Lower Threshold as high as possible without significantly degrading image quality. This will create broader regions of flat color in areas where the eye cannot perceive differences effectively.
3. If you have extreme whites in your image, flatten those as well by setting the Luma Upper Threshold advancedas low as possible without degrading visual quality.
4. Flatten Chroma Red and Chroma Blue by choosing the highest lower and lowest higher threshold as possible without significantly degrading visible image quality.
5. Choose Red and Blue Weighting as low as possible without causing significant clipping of red and blue.
6. Using less colors in the color table will cause HVS Color to create broader regions of similar color, and will visibly degrade image quality as less and less colors are used.
7. To achieve maximum lossless compression with HVS Color output, contact Digital Frontiers for information about our HVS Lossless encoder, which can provide much higher compression than GIF with no loss in image quality.
Contacting Digital Frontiers
If you need to contact Digital Frontiers customer support:
For technical support and customer service: 800-328-7789